class Fast extends Thread{
    @Override
    public void run() {
        for(int i=0;i<20;i++){
            System.out.println("快线程"+i);
            try{
                Thread.sleep(1000);
            }
            catch(InterruptedException e){}
        }
    }
}
class Slow implements Runnable{
    public void run(){
        for(int i=0;i<20;i++){
            System.out.println("慢线程==============="+i);
            try{
                Thread.sleep(2000);
            }
            catch (InterruptedException e){}
        }
    }
}
public class Test {
    public static void main(String[] args) {
        Fast f=new Fast();
        f.start();

        Slow s=new Slow();
        Thread thread=new Thread(s);
        thread.start();
    }
}
